from django.shortcuts import render, redirect, reverse



def login_require(func):
    def wrapper(request, *args, **kwargs):
        if request.session.get('user_id'):
            pass
        else:
            return redirect(reverse("login"))

        return func(request, *args, **kwargs)
    return wrapper
